package com.rescue.forum.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
 * 点赞记录
 * @TableName like_record
 */
public class LikeRecord implements Serializable {
    public static final Integer ARTICLE = 0;
    public static final Integer COMMENT = 1;

    private static final long serialVersionUID = 1L;
    /**
     * 自增ID
     */
    @NotNull(message = "[自增ID]不能为空")
    @ApiModelProperty("自增ID")
    private Integer opId;
    /**
     * 操作类型0:文章点赞 1:评论点赞
     */
    @ApiModelProperty("操作类型0:文章点赞 1:评论点赞")
    private Integer opType;


    private String articleId;
    private Integer commentId;
    /**
     * 用户ID
     */
    @NotBlank(message = "[用户ID]不能为空")
    @Size(max = 15, message = "编码长度不能超过15")
    @ApiModelProperty("用户ID")
    private Integer userId;
    /**
     * 发布时间
     */
    @ApiModelProperty("发布时间")
    private LocalDateTime createTime;
    /**
     * 主体作者ID
     */
    @Size(max = 15, message = "编码长度不能超过15")
    @ApiModelProperty("主体作者ID 文章or评论 ")
    private Integer authorUserId;

}
